<!DOCTYPE html>
<html  lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
	<meta charset="utf-8">
	<meta name="renderer" content="webkit">
	<meta name="viewport" content="width=device-width,user-scalable=no, initial-scale=1">
	<meta name="decorator" content="ani"/>
	<link rel="stylesheet" type="text/css" href="../src/css/index.css">

	<link rel="stylesheet" type="text/css" href="../src/css/news_login_apply.css">
	<script src="../src/js/jquery-2.1.4.min.js"></script>
	<!--<script src="../src/js/jquery-validation/1.14.0/jquery.validate.js" type="text/javascript"></script>-->
	<!--<script src="../src/js/jquery-validation/1.14.0/localization/messages_zh.min.js" type="text/javascript"></script>-->
	<!--<script src="../src/js/jquery-validation/1.14.0/validation-methods.js" type="text/javascript"></script>-->
	<script src="../src/js/md5.js"></script>
    <!--<script src="../src/js/md5.js"></script>-->
	<style type="text/css">
        .logos{
			margin-top: 24%;
			margin-bottom: 14%;
			text-align: center;
		}
		.form-control {
			display: block;
			width: 100%;
			padding: 6px 12px;
			font-size: 14px;
			line-height: 1.6;
			color: #555;
			background-color: #fff;
			border: 1px solid #ccc;
			border-radius: 1.12rem;
			-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
			box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
			-webkit-transition: border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;
			-o-transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
			transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
		}
		.form-control:HOVER{
			-webkit-transition:border linear .2s,-webkit-box-shadow linear .5s;
			border-color: #1381cc
			/*border-color: rgba(30, 120, 210, 0.75);*/
			/*-webkit-box-shadow:0 0 18px rgba(30, 120, 210, 0.75);*/
		}
	</style>
	<title>登录</title>
</head>
<body style="margin: 0px">
<div class="zy_login_box" style="padding-top: 25%;">
	<!-- 内容框 -->
	<div class="zy_module-content">
		<div class="login_box">
			<!--<div class="logo"><img src="../src/img/web/logo02.png"></div>-->
			<div class="logos"><strong style="font-size: 37px;color: #5895eb">压力传感器</strong></div>
			 <form id="loginForms" role="form">
				<div>
					<label class="form-control" ><a><img src="../src/img/web/zy_icon_user.png"></a>
						<input type="text" id="username" name="username" placeholder="用户名">
					</label>
				</div>
				<div>
					<label  class="form-control" ><a><img src="../src/img/web/zy_icon_mm.png"></a>
						<input type="password" id="password" name="password" placeholder="密码"></label>
                        <input id="mobileLogin" name="mobileLogin" value="true" style="display: none">
				</div>
				<h2>
				</h2>
			</form>
			<button style="line-height: 1.5;" class="zy_login_btn" type="submit" id="login">登   录</button>
		</div>
	</div>
</div>
<script type="text/javascript">
	// $(document).ready(function() {
	/**$("#loginForm").validate({
                    messages: {
                        username: {required: "请填写用户名."},password: {required: "请填写密码."}
                    },
                    submitHandler: function(form){
                        $.ajax({
                            type: "POST",//方法类型
                            url: "${wxCtx}/wx/login",
                            data: { username:$('#username').val(),
								   password:$.md5($('#password').val())
							},
							dataType : 'json',
							success: function (data) {
                            	if(data.body.code!=200){
									toast(data.msg, 1500);
								}else{
                            		var d = data.body.user;
									sessionStorage.setItem('userId',d.id);
									sessionStorage.setItem('officeId',d.office.id);
									sessionStorage.setItem('roleId',d.role.id);
									sessionStorage.setItem('userName',d.name);
									sessionStorage.setItem('officeName',d.office.name);
									sessionStorage.setItem('photo',d.photo);
									window.location.href = "${path}/wxHome?officeId="+d.office.id+"&roleId="+d.role.id;
								}
                            }
                        });
                    },
                    errorPlacement: function(error, element) {
                        console.log("error------",error);
                    }
                });**/
	// });
	$("#login").click(function() {
		console.log("/view/main");
		window.location.href = "/view/main";
	});
	function toast(msg, duration) {
		duration = isNaN(duration) ? 3000 : duration;
		var m = document.createElement('div');
		m.innerHTML = msg;
		m.style.cssText = "font-family:siyuan;max-width:60%;min-width: 150px;padding:0 14px;height: 40px;color: rgb(255, 255, 255);line-height: 40px;text-align: center;border-radius: 4px;position: fixed;top: 50%;left: 50%;transform: translate(-50%, -50%);z-index: 999999;background: rgba(0, 0, 0,.7);font-size: 16px;";
		document.body.appendChild(m);
		setTimeout(function() {
			var d = 0.5;
			m.style.webkitTransition = '-webkit-transform ' + d + 's ease-in, opacity ' + d + 's ease-in';
			m.style.opacity = '0';
			setTimeout(function() {
				document.body.removeChild(m)
			}, d * 1000);
		}, duration);
	}
</script>
</body>
</html>